<?php
/**
 * Created by JetBrains PhpStorm.
 * User: thanh
 * Date: 4/15/12
 * Time: 4:08 PM
 * To change this template use File | Settings | File Templates.
 */
class RegisterClass extends CPortlet
{
    public $list_facility;
    public $list_training;
    public function init()
    {

        parent::init();
    }

    public function renderContent(){
        $this->list_facility = $this->getFacilities();
        $this->list_training = $this->getTraining();
        $model = new XepLop();
        $this->render('register_class',array('list_facility'=>$this->list_facility,'list_training'=>$this->list_training,'model'=>$model));
    }

    public function getFacilities(){
        $facility = Facility::model()->findAll('status=1');
        return CHtml::listData($facility,'id','title');
    }
    public function getTraining(){
        $training = Training::model()->findAll('status=1');
        return CHtml::listData($training,'id','name');
    }
}
